import java.util.Scanner;

public class test {
    public static void main(String[] args) {
//        获取一个数二进制序列中所有的偶数位和奇数位， 分别输出二进制序列
        Scanner scan = new Scanner(System.in);
        int count = 1;
        int num = scan.nextInt();
        int mid = num;
        while(mid != 0){
            if(count % 2 ==0) {
                System.out.print(mid % 2);
            }
            count++;
            mid /= 2;
        }
        System.out.println();
        mid = num;
        count = 1;
        while(mid != 0) {
            if (count % 2 != 0){
                System.out.print(mid % 2);
            }
            count ++;
            mid /= 2;
        }

    }
}
